﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.MapNotificationTypes.SettlementOwnerChangedMapNotification
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using System.Collections.Generic;
using TaleWorlds.CampaignSystem.Settlements;
using TaleWorlds.Core;
using TaleWorlds.Localization;
using TaleWorlds.SaveSystem;

#nullable disable
namespace TaleWorlds.CampaignSystem.MapNotificationTypes
{
  public class SettlementOwnerChangedMapNotification : InformationData
  {
    internal static void AutoGeneratedStaticCollectObjectsSettlementOwnerChangedMapNotification(
      object o,
      List<object> collectedObjects)
    {
      ((InformationData) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      base.AutoGeneratedInstanceCollectObjects(collectedObjects);
      collectedObjects.Add((object) this.PreviousOwner);
      collectedObjects.Add((object) this.NewOwner);
      collectedObjects.Add((object) this.Settlement);
    }

    internal static object AutoGeneratedGetMemberValuePreviousOwner(object o)
    {
      return (object) ((SettlementOwnerChangedMapNotification) o).PreviousOwner;
    }

    internal static object AutoGeneratedGetMemberValueNewOwner(object o)
    {
      return (object) ((SettlementOwnerChangedMapNotification) o).NewOwner;
    }

    internal static object AutoGeneratedGetMemberValueSettlement(object o)
    {
      return (object) ((SettlementOwnerChangedMapNotification) o).Settlement;
    }

    public override TextObject TitleText => new TextObject("{=b6BunI6y}Settlement Owner Changed");

    public override string SoundEventPath => "event:/ui/notification/settlement_owner_change";

    [SaveableProperty(10)]
    public Hero PreviousOwner { get; private set; }

    [SaveableProperty(20)]
    public Hero NewOwner { get; private set; }

    [SaveableProperty(30)]
    public Settlement Settlement { get; private set; }

    public SettlementOwnerChangedMapNotification(
      Settlement settlement,
      Hero newOwner,
      Hero previousOwner,
      TextObject descriptionText)
      : base(descriptionText)
    {
      this.PreviousOwner = previousOwner;
      this.NewOwner = newOwner;
      this.Settlement = settlement;
    }
  }
}
